#!/usr/bin/env python
# -*- coding: utf-8 -*-

# This file is part of Beremiz
#
# Copyright (C) 2007: Laurent BESSARD
# Copyright (C) 2007-2018: Edouard TISSERANT
#
# See COPYING file for copyrights details.
import wx

from HMI.hmi_root import HMIRootClass
from IOTLibrary import IOTLibrary
from MotionLibrary.MotionLibrary import MotionLibrary
from MotionLibrary.extension import GetCamEditorClass, GetKinematicEditorClass
from board import board_root
from device_serial import device
from etherlab import etherlab
from etherlab.EthercatMaster import EtherlabLibrary
from .NativeLib import NativeLibrary
from .c_ext import c_ext
from .canfestival import canfestival
from .modbus import modbus
from .py_ext import PythonLibrary, py_ext

_ = wx.GetTranslation
libraries = [
    ('Native', NativeLibrary, True),
    ('Etherlab', EtherlabLibrary, False),
    ('Motion', MotionLibrary, False),
    ('IOT', IOTLibrary, False),
    ('Python', PythonLibrary, False),
    ('SVGHMI', 'svghmi.SVGHMILibrary', False)]

catalog = [
    ('opcua', _('OPC-UA client'), _('Map OPC-UA server as located variables'), 'opc_ua.OPCUAClient'),

    ('board', _('Board'), _('IO Board'), board_root.RootClass),
    ('modbus', _('Modbus support'), _('Map located variables over Modbus'), modbus.RootClass),
    ('HMI', _('HMI'), _('Human Machine Interface'), HMIRootClass),
    ('etherlab', _('EtherCat Master'), _('Map located variables over EtherCat'), etherlab.RootClass),
    ('serialdevice', _('serial device'), _('serial device'), device.RootClass),
    # ('TestPlan', _('test plan'), _('test plc project'), TestPlan.RootClass),
    # ('svgWeb', _('SVGWEB'), _('Experimental web based HMI'), 'svgWeb.SVGWEB'),
    ('canfestival', _('CANopen support'), _('Map located variables over CANopen'), canfestival.RootClass),
    # ('bacnet', _('Bacnet support'), _('Map located variables over Bacnet'), bacnet.RootClass),
    ('c_ext', _('C extension'), _('Add C code accessing located variables synchronously'), c_ext.CFile),
    ('py_ext', _('Python file'), _('Add Python code executed asynchronously'), py_ext.PythonFile),
    # ('wxglade_hmi', _('WxGlade GUI'), _('Add a simple WxGlade based GUI.'), wxglade_hmi.WxGladeHMI),
    ('svghmi', _('SVGHMI'), _('SVG based HMI'), 'svghmi.SVGHMI')]

file_editors = [('.csv', 'Cam Editor', GetCamEditorClass),
                ('.hki', 'Kinematic Editor', GetKinematicEditorClass)]
